#!/bin/bash


#################################################
#
#  @author： man deep as the sea
#  @date  :  2021-04-15
#  @desc  :  app日志ods到dwd处理etl任务
#  @contact: 13813838383388
#
#################################################

export JAVA_HOME=/opt/apps/jdk-11.0.9/
export HIVE_HOME=/opt/apps/hadoop-3.1.1/ 
export HADOOP_HOME=/opt/apps/hive-3.1.2/
export SPARK_HOME=/opt/apps/spark-3.1.1-bin-hadoop2.7

dt=$(date -d'-1 day' +%Y-%m-%d)

if [ $1 ]
then 
  dt=$1
fi  

# 提交spark job
${SPARK_HOME}/bin/spark-submit \
--master yarn   \
--deploy-mode client  \
--class doit20.datayi.etl.ApplogODS2DWD   \
--driver-memory 2G    \
--executor-memory 2G    \
--executor-cores 1    \
--queue default    \
--num-executors 2   \
--jars /root/mysql-connector-java-8.0.23.jar  \
--driver-class-path /root/mysql-connector-java-8.0.23.jar \
/root/doit20.jar  ${dt} 
